package util;
//
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class HikariUtil {

    private static HikariDataSource dataSource;
    static{
        try{
            Class.forName("com.mysql.cj.jdbc.Driver");

            HikariConfig Config = new HikariConfig("hikari.properties");
            dataSource = new HikariDataSource(Config);

        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
    public static Connection getConn() throws SQLException,ClassNotFoundException{

        try{
            return dataSource.getConnection();
        }catch (SQLException e){
            throw new RuntimeException();
        }
    }
}
